import java.util.Scanner;

public class demo06 {
    public static void main(String[] args) {
        int[] a=new int[]{4,5,34,2,7,6};
        Scanner  sc=new Scanner(System.in);
        System.out.println("请输入你要查找的数:");
        int b=sc.nextInt();
        int c=0;
        int d=0;
        boolean flag=false;
        for (int i=0;i<a.length;i++){
            c=a[i];
            if (c==b){
                d=i;
                flag=true;
            }
        }
        if (flag){
            System.out.println("找到了下标为"+d);
        }else{
            System.out.println("没找到");
        }

    }
}
